<#assign pages =pageModel />
<#if search?? && search>
	<#assign searchStr = condition />
</#if>
<#if (pages.pageIndex >= pages.pages) && (pages.pages != 0)>

	<#assign index = pages.pages />
<#else>
	<#assign index = pages.pageIndex />
</#if>
<!--分页索引最长为8-->
<#if pages.pages%8==0>
	<#assign col = pages.pages/8 />
<#else>
	<#assign col = pages.pages/8+1 />
</#if>
<#list 1..col as i>
	<#if index lte i*8>
		<#assign start =i*8-7 />
		<#if pages.pages lt i*8>
			<#assign end =pages.pages />
		<#else>
			<#assign end =i*8 />
		</#if>
		<#break>
	</#if>
</#list>
<#macro "page" pageUrl >
  <nav>
    <ul class="pagination">
        <li class="disabled"><a href="#">共${pageModel.pageSize}条</a></li>
        <li  <#if pages.firstPage> class="disabled"</#if> >
	      <a href="<#if pages.lastPage>javascript:void(0);<#else>${pageUrl}?pageIndex=${index-1}${searchStr!}</#if>">
	      	<i class="fa fa-angle-left"></i>
	      </a>
	    </li>
	    <#list start..end as page>
		    <li  <#if index==page>class="active"</#if>>
			    <a href="${pageUrl}?pageIndex=${page}${searchStr!}">${page}</a>
		    </li>
		</#list>
		<li  <#if pages.lastPage> class="disabled"</#if> >
	      <a href="<#if pages.lastPage>javascript:void(0);<#else>${pageUrl}?pageIndex=${index+1}${searchStr!}</#if>" aria-label="Next">
	        <i class="fa fa-angle-right"></i>
	      </a>
	    </li>
    </ul>
</nav>
</#macro>